package com.lbd99.data.lbd.service;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lbd99.data.lbd.dao.TExchangeLogMapper;
import com.lbd99.data.lbd.dao.TTransferDetailMapper;
import com.lbd99.data.lbd.dao.TUserMapper;
import com.lbd99.data.lbd.dao.TUserOrderRelationMapper;
import com.lbd99.data.lbd.vo.SysAccount;
import com.lbd99.data.lbd.vo.TUser;

@Service
public class StatisticService {
	@Autowired
	private TUserMapper tUserMapper;
	@Autowired
	private TTransferDetailMapper tTransferDetailMapper;
	@Autowired
	private  TUserOrderRelationMapper tUserOrderRelationMapper;
	@Autowired
	private TExchangeLogMapper tExchangeLogMapper;
	public Map<String, Object> statisticData(Map<String, Object> map){
		Map<String,Object> dataMap=new LinkedHashMap<String,Object>();
			Integer regCountToday = tUserMapper.regCountToday(map);
		dataMap.put("regCountToday", regCountToday);//当天注册人数
			Integer regCountWeek =tUserMapper.regCountWeek(map);
		dataMap.put("regCountWeek", regCountWeek);//本周注册人数
			Integer transferCountToday =tTransferDetailMapper.transferCountToday(map);
		dataMap.put("transferCountToday", transferCountToday);//当天转账多少笔
			Integer transferCountWeek =tTransferDetailMapper.transferCountWeek(map);
		dataMap.put("transferCountWeek", transferCountWeek);//本周转账
			Integer tradeCountToday = tUserOrderRelationMapper.tradeCountToday(map);
		dataMap.put("tradeCountToday", tradeCountToday);//当天买卖成交多少笔
			Integer tradeCountWeek =tUserOrderRelationMapper.tradeCountWeek(map);
		dataMap.put("tradeCountWeek", tradeCountWeek);//本周买卖成交多少笔
Integer exchangeCountToday = tExchangeLogMapper.exchangeCountToday(map);
		dataMap.put("exchangeCountToday", exchangeCountToday);//当天兑换多少笔
Integer exchangeCountWeek =tExchangeLogMapper.exchangeCountWeek(map);
		dataMap.put("exchangeCountWeek", exchangeCountWeek);//本周兑换多少笔
		Map<String,Object> resultMap=new HashMap<String,Object>();
		resultMap.put("isSuc",true);
		resultMap.put("data", dataMap);
		return resultMap;
	}

}
